<html>
	<head>
		<title>Laporan Penerimaan Cabang</title>
		<style>
			#list_biaya{
				font-size: 10px;
			}
		</style>
	</head>
	<body>
		<center><h1>Laporan Penerimaan Cabang</h1></center>
		<br/><br/>
		Cabang : <?php echo $cabang?>
		<br/>
		Tanggal awal : <?php echo $tgl_awal?>
		<br/>
		Tanggal akhir : <?php echo $tgl_akhir?>
		<br/>
		<table id="list_biaya" align="center" border="1">
			<thead>
				<tr>
					<th>No</th>
					<th>Nama</th>
					<th>Kode Cabang</th>
					<th>Alamat</th>
					<th>Telp</th>
					<th>Total Tiket</th>
					<th>Total Tiket Void</th>
					<th>Total Omset</th>
					<th>Total Discount</th>
					<th>Total Fee Agen</th>
					<th>Total Void</th>
					<th>Total Biaya Langsung</th>
					<th>Total Setor</th>
					<th>Total Biaya OP Awal</th>
					<th>Total Laba Kotor</th>
				</tr>
			</thead>
			<tbody>
				<?php for($i=0;$i<count($list_result);$i++){?>
				<tr>
					<td align="center"><?php echo $i+1?></td>
					<td align="center"><?php echo $list_result[$i]['cabang_keberangkatan']?></td>
					<td align="center"><?php echo $filter_cabang['kode_cabang'][$list_result[$i]['cabang_keberangkatan']]?></td>
					<td align="center"><?php echo $filter_cabang['alamat_cabang'][$list_result[$i]['cabang_keberangkatan']]?></td>
					<td align="center"><?php echo $filter_cabang['telp_cabang'][$list_result[$i]['cabang_keberangkatan']]?></td>
					<td align="center"><?php echo $list_result[$i]['total_penumpang']?></td>
					<td align="center"><?php echo $list_result[$i]['tiket_void']?></td>
					<td align="center">Rp <?php echo number_format($list_result[$i]['total_omset'],0,',','.')?></td>
					<td align="center">Rp <?php echo number_format($list_result[$i]['total_discount'],0,',','.')?></td>
					<td align="center">Rp <?php echo number_format($list_result[$i]['fee_agen'],0,',','.')?></td>
					<td align="center">Rp <?php echo number_format($list_result[$i]['total_void'],0,',','.')?></td>
					<td align="center">Rp 
						<?php 
							if($biaya_langsung){
								echo number_format($biaya_langsung[$list_result[$i]['cabang_keberangkatan']],0,',','.');
							}else{
								echo number_format(0,0,',','.');
							}
						?>
					</td>
					<td align="center">Rp <?php echo number_format($list_result[$i]['total_setoran'],0,',','.')?></td>
					<td align="center">Rp 
						<?php 
							if($biaya_opawal){
								echo number_format($biaya_opawal[$list_result[$i]['cabang_keberangkatan']],0,',','.');
							}else{
								echo number_format(0,0,',','.');
							}
						?>
					</td>
					<td align="center">Rp <?php echo number_format($list_result[$i]['total_laba'],0,',','.')?></td>
				</tr>
				<?php }?>
			</tbody>
		</table>
	</body>
</html>